util/progress: no progress reporting in dumb terminals
authorAndreas Tolfsen <ato@sny.no>
Mon, 18 Dec 2017 16:01:30 +0000 (16:01 +0000)
committerAndreas Tolfsen <ato@sny.no>
Mon, 18 Dec 2017 16:01:30 +0000 (16:01 +0000)
commit274f9ce40d300be5ee898809bfeee027a31afc48
treeb6bbaf65ea36b26a67557f64965fb029dd6d4b66
parent4f6b265f69187c71479c20c8cab03be02662f66e
util/progress: no progress reporting in dumb terminals

cargo should not assume that all terminals have direct access to
the terminal.  Dumb terminals are those that can interpret only a
limited number of control codes (CR, LF, &c.) and the escape codes
used by the progress bar breaks output in these by asserting control
over the cursor position to draw a bar.

A dumb terminal is identified by the TERM output variable being set to
"dumb".  This adds a direct check for this in src/cargo/util/progress.rs
because TERM=dumb does not imply the same as the -q flag.
src/cargo/util/progress.rs